package cn.zw.design.order.formal;

public class User {
	
	public static void main(String[] args) {
		
		
		Tv tv = new Tv();
		Command onCommand = new TurnOnTv(tv);
		Command changeChannel = new ChangeChannelTV(tv, 5);
		Command offCommand = new  TurnOffTv(tv);
		Invoker invoker = new Invoker();
		invoker.setCommand(onCommand);
		invoker.runCommand();
		invoker.setCommand(changeChannel);
		invoker.runCommand();
		invoker.runUndoCommand();
		invoker.setCommand(offCommand);
		invoker.runCommand();
		

	/*	DVD dvd = new DVD();
		Command onDvd = new TurnOnDVD(dvd);
		Command offDvd = new TurnOffDVD(dvd);
		Invoker invoker = new Invoker();
		invoker.setCommand(onDvd);
		invoker.runCommand();
		invoker.setCommand(offDvd);
		invoker.runCommand();
		
		invoker.runUndoCommand();*/
		
		
	}

}
